#include"ProcessPool.hpp"
#include"Task.hpp"


void Usage(std::string proc)
{
	std::cout << "Usage: " << proc << "process-num" << std::endl;
}

int main(int argc,char* argv[])
{
	if(argc != 2){
		Usage(argv[0]);
		return UsageError;
	}

	int num = std::stoi(argv[1]);
	
	ProcessPool *pp = new ProcessPool(num, Worker); 
	pp->InitProcessPool();
	pp->DispatchTask();
	pp->CleanProcessPool();


	delete pp;


	// std::vector<Channel> channels;
	// // 1.初始化进程池
	// InitProcessPool(num,channels,Worker);
	// Print(channels);
	
	// // 2.轮询派发任务
	// DispatchTask(channels); 
	
	
	// // 3.退出&&清理进程池
	// CleanProcessPool(channels);
	

    return 0;
}